toolitemgroup: Use gtk_widget_queue_draw()
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Oct 2016 20:27:43 +0000 (22:27 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 27 Oct 2016 03:07:23 +0000 (05:07 +0200)
gtk/gtktoolitemgroup.c

index ab6534b024ae63045f9a386a63694e75ab3981c2..27ef6df5a24430cb5fca00b18e8f18ae85f4a9a3 100644 (file)
@@ -1097,8 +1097,7 @@ gtk_tool_item_group_size_allocate (GtkWidget     *widget,
 {
   gtk_tool_item_group_real_size_allocate (widget, allocation);
 
-  if (gtk_widget_get_mapped (widget))
-    gdk_window_invalidate_rect (gtk_widget_get_window (widget), NULL, FALSE);
+  gtk_widget_queue_draw (widget);
 }
 
 static void
@@ -1832,17 +1831,15 @@ gtk_tool_item_group_force_expose (GtkToolItemGroup *group)
     {
       GtkAllocation frame_allocation;
       GtkWidget *frame = gtk_tool_item_group_get_frame (group);
-      GdkRectangle area;
 
-      /* Find the header button's arrow area... */
+      /* Find the header button's arrow area and
+       * invalidate it to get it animated. */
       gtk_widget_get_allocation (frame, &frame_allocation);
-      area.x = frame_allocation.x;
-      area.y = frame_allocation.y + (frame_allocation.height - priv->expander_size) / 2;
-      area.height = priv->expander_size;
-      area.width = priv->expander_size;
-
-      /* ... and invalidated it to get it animated. */
-      gdk_window_invalidate_rect (gtk_widget_get_window (priv->header), &area, TRUE);
+      gtk_widget_queue_draw_area (priv->header,
+                                  frame_allocation.x,
+                                  frame_allocation.y + (frame_allocation.height - priv->expander_size) / 2,
+                                  priv->expander_size,
+                                  priv->expander_size);
     }
 
   if (gtk_widget_get_realized (widget))